#ifndef X1__H
#define X1__H

#include "common.h"

template <AllegroVersion version>
struct x10
{
    uint32_t t;
    uint32_t k;
    
    // Instance
    uint32_t ptr1;
    
    uint32_t ptr2;
    
    // Always null?
    uint32_t un1;
    
    uint32_t ptr3;
    
    // Points to a footprint (x0F) or so that I can't print right now?
    uint32_t ptr4;
    
    // Something like:
    // "@beagle_xm_revcb.schematic(sch_1):ins21222351@beagle_d.\tfp410.normal\(chips)"
    // or occasionally like:
    // ".\pstchip.dat"
    // or even like:
    // "L:/hdllib2/library/mechanical/rpv64101#2f02r1/chips/chips.prt"
    uint32_t path_str;
    
    uint32_t TAIL;
    operator x10<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};

#if __cplusplus >= 202002L
template <AllegroVersion version> requires(version >= A_172)
struct x10<version>
{
    uint32_t t;
    uint32_t k;
    uint32_t un2;

    // Instance
    uint32_t ptr1;

    COND_FIELD(version >= A_174, uint32_t, un3);

    uint32_t ptr2;

    // Always null?
    uint32_t un1;

    uint32_t ptr3;

    // Points to a footprint (x0F) or so that I can't print right now?
    uint32_t ptr4;

    // Something like:
    // "@beagle_xm_revcb.schematic(sch_1):ins21222351@beagle_d.\tfp410.normal\(chips)"
    // or occasionally like:
    // ".\pstchip.dat"
    // or even like:
    // "L:/hdllib2/library/mechanical/rpv64101#2f02r1/chips/chips.prt"
    uint32_t path_str;

    uint32_t TAIL;
    operator x10<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};
#else
template <> struct x10<A_172>
{
    uint32_t t;
    uint32_t k;
    uint32_t un2;

    // Instance
    uint32_t ptr1;

    uint32_t ptr2;

    // Always null?
    uint32_t un1;

    uint32_t ptr3;

    // Points to a footprint (x0F) or so that I can't print right now?
    uint32_t ptr4;

    // Something like:
    // "@beagle_xm_revcb.schematic(sch_1):ins21222351@beagle_d.\tfp410.normal\(chips)"
    // or occasionally like:
    // ".\pstchip.dat"
    // or even like:
    // "L:/hdllib2/library/mechanical/rpv64101#2f02r1/chips/chips.prt"
    uint32_t path_str;

    uint32_t TAIL;
    operator x10<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};

template <> struct x10<A_174>
{
    uint32_t t;
    uint32_t k;
    uint32_t un2;

    // Instance
    uint32_t ptr1;

    uint32_t un3;

    uint32_t ptr2;

    // Always null?
    uint32_t un1;

    uint32_t ptr3;

    // Points to a footprint (x0F) or so that I can't print right now?
    uint32_t ptr4;

    // Something like:
    // "@beagle_xm_revcb.schematic(sch_1):ins21222351@beagle_d.\tfp410.normal\(chips)"
    // or occasionally like:
    // ".\pstchip.dat"
    // or even like:
    // "L:/hdllib2/library/mechanical/rpv64101#2f02r1/chips/chips.prt"
    uint32_t path_str;

    uint32_t TAIL;
    operator x10<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};
#endif

#endif // X1__H
